<?php
include("chk_permission.php");//must to be member
//check permission -------------------------
if($user_type <> "2" && $user_type <> "3"  && $user_type <> "4"  && $user_type <> "5"){// member
	?>
		<script type="text/javascript">
			window.location.href='index.php';
		</script>
	<?
		exit();
}
// -----------------------------------------
include("connect/connect_dsccmis.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="css/styletabz.css" type="text/css" rel="stylesheet"/>
<script src="common/jsfunction.js" type="text/javascript"></script>
<style type="text/css">
<!--
body {
	background-image: url(images/background01.jpg);
}
.style1 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: normal;
	font-size: 14px;
}
.style3 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 14px; }
-->
</style></head>
<body>
<?php
$perid=$_GET["perid"];
$sql = "select fullname,regnme,stsmarnme,roladr,rolvllno,rolvllsoi,rolplcnmegen,adr,vllno,vllsoi,plcplcnmegen,losbodynme,evnid,evndte,evntme,plcnmegen,evnnme,evnid from dscc.viewlosofper where perid='$perid' order by evndte,evntme";
//echo $sql;

$result = mysql_query($sql);
$row = mysql_fetch_array($result);
?>
<table>
	<tr class="style1">
    	 <td><span class="style3">รายละเอียดผู้ได้รับผลกระทบ</span></td>
  </tr>
    <tr class="style1">
      <td><?=$row[0]?></td>
  </tr>
    <tr class="style1">
      <td>ที่อยู่ปัจจุบัน:        <?=$row[10]?></td>
  </tr>
    <tr class="style1">
      <td>ที่อยู่ตามทะเบียนบ้าน:        <?=$row[6]?></td>
  </tr>
    <tr class="style1">
      <td>ประสบเหตุเมื่อ&nbsp;:&nbsp;<u><a href="#" onClick="popUp('show_event_des.php?evnid=<?=$row[17]?>','400','400');"><?=substr($row[13],6,2)."/".substr($row[13],4,2)."/".substr($row[13],0,4)?> เวลา:<?=substr($row[14],0,2).":".substr($row[14],2,2)." น.</u>"?></a>
<?php
	while($row = mysql_fetch_array($result)){
		echo " , <u><a href=\"#\" onclick=\"popUp('show_event_des.php?evnid=".$row[17]."','400','400');\">".substr($row[13],6,2)."/".substr($row[13],4,2)."/".substr($row[13],0,4)?> เวลา:<?=substr($row[14],0,2).":".substr($row[14],2,2)." น.</u></a>";
	}
?>  </td>
</tr></table>
<?php
mysql_close();
?>
<br />
<p align="center">
<input name="btprint" type="button" value="พิมพ์" onClick="window.print();"/></p>
</body>
</html>